<template>
  <div>
    <div v-if="attendata.length!==0">
      <div class="atten_items" v-for="(item,index) in attendata" :key="index">
        <img v-if="item.head_img" :src="$axios.defaults.baseURL+item.head_img" class="icon" alt />
        <img v-else src="@/assets/logo.png" alt />
        <div class="centerInfo">
          <div class="title">{{item.nickname}}</div>
          <div class="time">{{item.create_date.split("T")[0]}}</div>
        </div>
        <div class="cancelBtn">
          <span @click="SendId(item.id)">取消关注</span>
        </div>
      </div>
    </div>
    <div v-else class="defaultPage">
      <img src="@/images/eye.png" alt />
      <h2>您目前还没有关注哦！</h2>
    </div>
  </div>
</template>
<script>
export default {
  props: ["attendata"],
  mounted() {
    console.log(this.attendata);
  },
  methods: {
    SendId(Id) {
      this.$emit("SendId", Id);
    }
  }
};
</script>
<style lang="less" scoped>
.atten_items {
  display: flex;
  padding: 5.556vw 5vw;
  //20px 18px
  align-content: center;
  border-bottom: 1px solid #ccc;

  .icon {
    width: 11.111vw;
    height: 11.111vw;
    border-radius: 50%;
    background-color: #f5f5f5;
    // 40px
  }
  .centerInfo {
    flex: 1;
    padding-left: 3.889vw;
    .title {
      font-size: 4.444vw;
    }
    .time {
      font-size: 3.889vw;
      color: #777;
    }
  }
  .cancelBtn {
    background-color: #e1e1e1;
    width: 20.556vw;
    height: 8.333vw;
    line-height: 8.333vw;
    border-radius: 13.889vw;
    font-size: 13px;
    text-align: center;
    &:active {
      background-color: #ea2e03;
      color: #fff;
    }
  }
}
.defaultPage {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  width: 220px;
  margin: 30px auto;
  left: 50%;
  top: 50%;
  img {
    width: 25%;
    vertical-align: middle;
  }
  h2 {
    flex: 1;
    font-weight: normal;
    font-size: 16px;
    color: #999;
  }
}
</style>